mail = "[email protected]" name = mail.split("@")[0].replace("."," ") # splits it at the @, grab the first part and replace the "." with a space # you get "studentvn studentfn"